package com.colin.aiyi.adapter;


import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.colin.aiyi.R;
import com.colin.aiyi.app.Constant;
import com.colin.aiyi.entity.CommentEntity;
import com.colin.aiyi.entity.SayDetail;
import com.colin.aiyi.utils.TimeUtil;

import java.util.Date;
import java.util.List;


public class CommnetAdapter extends BaseQuickAdapter<CommentEntity,BaseViewHolder> {

    private Context context;

    public CommnetAdapter(List<CommentEntity> list) {
        super(R.layout.item_pinglun, list);
       // this.context = context;
    }



    @Override
    protected void convert(BaseViewHolder helper, CommentEntity item) {
        ImageView img_head=helper.getView(R.id.img_head);
        Glide.with(img_head.getContext()).load(Constant.BASE_URL+item.getUserHeadImg()).error(R.mipmap.pic2).into(img_head);
      //  helper.setText(R.id.text_title,item.getTitle());
        helper.setText(R.id.text_time, TimeUtil.getTime(new Date(item.getCreatedTime()),TimeUtil.DATE_FORMAT_DATE));
        helper.setText(R.id. text_decs,item.getContent());

    }


}
